#pre-requisites
source /pentest/AH/pentest.config
_tftpOut=/job/tftp/
mkdir ${_tftpOut}
echo "Need to add a way to check the existence of the /job/tftp, but generically across all autoscripts"

#body
query='select ipaddress,port from services where service = "tftp" and protocol = "udp" and state = "open" or port = "69" and protocol = "udp" and state = "open"'
cmd="msfcli auxiliary/scanner/tftp/tftpbrute RHOSTS=\${1} RPORT=\${2} -THREADS=5 E > ${_tftpOut}\${1}.tftp"
/opt/python3/bin/python3 /root/workspace/q2ex/src/q2ex.py -d /job/test.db -q "$query" -c "$cmd"

#post-requisites
